package com.woniuxy.dao;

import com.woniuxy.entity.PaperAttribute;
import com.woniuxy.entity.PaperObject;
import com.woniuxy.entity.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PaperDao {
    /*添加考试信息*/
    int addPaperAttribute(PaperAttribute paperAttribute);
    /*查询添加考试的id*/
    int findNewId();
    /*根据类型查询对应的题目*/
    List<Question>  findQuestion(int questionId,int newId);

    /*增加题目到试卷表*/
    int addPaperByQuestion(@Param("questionList") List<Question> questionList, @Param("newId") int newId);

    /*查询以及组装好的试卷根据试卷id*/
    List<PaperObject> findAllTopic(int paperId);
    /*查询非选择题*/
    List<PaperObject> findAllTopicNotSelect(int paperId);

    /*删除试卷*/
    int deleteTopic(int NewId);

    /*批量删除题目从题目表*/
    int deleteTopicList(PaperObject paperObject);

    /*修改题的分数根据类型*/
    int updateTopicById(PaperObject paperObject);

    /*模糊查询题目*/
    List<Question> findAllQuestionBytitle(int questionId, int newId, String title);
}
